﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using Microsoft.VisualBasic.ApplicationServices;

namespace Light_Notes
{
    public class App : Application
    {
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);
            new MainWindow().Show();
        }
    }

    public class AppManager : WindowsFormsApplicationBase
    {
        private App app;

        public AppManager()
        {
            this.IsSingleInstance = true;
        }

        protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e)
        {
            app = new App();
            app.Run();
            return false;
        }

        protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs)
        {
            base.OnStartupNextInstance(eventArgs);
            app.MainWindow.Activate();
        }
    }

    public class EntryPoint
    {
        [STAThread]
        public static void Main(string[] args)
        {
            AppManager manager = new AppManager();
            manager.Run(args);
        }
    }
}
